package com.itheima.homework04;

public class Test05 {
    public static void main(String[] args) {
        double[] arr = {10.4,-3,-6.2,1.2,-6,-19,-3.8,0.9,-4.5,5.5};
        //创建两个变量记录亏损与盈利
        int a = 0,b = 0;
        for (int i = 0; i < arr.length; i++) {
            //通过循环纪录
            if(arr[i] > 0){
                a++;
            }else {
                b++;
            }
        }
        System.out.println("赚钱的股票一共有: "+a+"只");
        System.out.println("赔钱的股票一共有: "+b+"只");
    }
}
